package com.yxh.www.author.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 系统接口资源表
 * </p>
 *
 * @author Yangxiaohui
 * @since 2020-05-09
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@NoArgsConstructor
public class SmServerApi extends Model<SmServerApi> {

    private static final long serialVersionUID = 1L;

    /**
     * PK
     */
    @TableId(value = "id", type = IdType.ID_WORKER_STR)
    private String id;

    /**
     * 接口名称
     */
    @TableField("api_name")
    private String apiName;

    /**
     * 接口地址
     */
    @TableField("api_path")
    private String apiPath;

    /**
     * 接口地址Hash
     */
    @TableField("api_hash")
    private String apiHash;

    /**
     * 接口-服务ID
     */
    @TableField("server_id")
    private String serverId;

    /**
     * 接口-服务名
     */
    @TableField("SERVER_NAME")
    private String serverName;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private LocalDateTime createTime;

    /**
     * 权限标识识别
     */
    @TableField("permission_keys")
    private String permissionKeys;

    /**
     * 接口类型
     */
    @TableField("api_type")
    private String apiType;

    public SmServerApi(String id, String apiName, String apiPath, String apiHash, String serverId, String serverName, LocalDateTime createTime, String permissionKeys, String apiType) {
        this.id=id;
        this.apiName = apiName;
        this.apiPath = apiPath;
        this.apiHash = apiHash;
        this.serverId = serverId;
        this.serverName = serverName;
        this.createTime = createTime;
        this.permissionKeys = permissionKeys;
        this.apiType = apiType;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
